<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 伪类选择器：（：） */
        #div1>p:hover{
            background: #ccc;
            cursor: pointer;
        }

        #div1>p:first-child{
            color: red;
        }

        #div1>p:first-of-type{
            color: red;
        }
        #div1>p:nth-of-type(even){
            /* even偶数 odd奇数 */
            color: red;
        }

        /* 伪（元素）对象选择器: 必须要有content属性*/
        /* 在div1里面最上面填一个行元素 */
        #div1::before{
            content: "haha";
        }
        /* 在div1里面最下面填一个行元素 */
        #div1::after{
            content: "123";
        }
    </style>
</head>
<body>
    <div id="div1">
        <span>span1</span>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. </p>
        <p id="p2">Lorem ipsum dolor sit amet consectetur adipisicing elit. </p>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. </p>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. </p>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. </p>
    </div>
    
</body>
</html>